<?php
	require_once("../includes/database.php");
	$db=new Database(); 
 ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="add_qb_table">
  <tr>
    <td height="35"><div id="add_qb_status" class="strykerNotice"></div></td>
  </tr>
</table>
<script>
	$('#add_qb_table').ready(function(){
		$('#add_qb_status').html('Settings added Successfully please upload questions carefully').show(200);
	});
</script>
<?php
if($_POST['type']==2)
{
?>
<table id="ques_table" width="419" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="411">
    <div style="margin:0 auto">
    <table width="355" height="139" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="115" height="22" align="right" valign="top">Question : <span id="ques_up1">1 </span> </td>
        <td width="240" height="22" align="left"><textarea name="question1" id="question1" cols="30" rows="3" ></textarea></td>
      </tr>
      <tr>
        <td height="22" align="right">A :</td>
        <td height="22" align="left" ><input type="text" name="optone1" id="optone1" /></td>
      </tr>
      <tr>
        <td height="22" align="right">B :</td>
        <td height="22" align="left"><input type="text" name="opttwo1" id="opttwo1" /></td>
      </tr>
      <tr>
        <td height="22" align="right" >C :</td>
        <td height="22" align="left"><input type="text" name="optthree1" id="optthree1" /></td>
      </tr>
      <tr>
        <td height="22" align="right">D :</td>
        <td height="22" align="left"><input type="text" name="optfour1" id="optfour1" /></td>
      </tr>
      <tr>
        <td height="22" align="right">Ans :</td>
        <td height="22" align="left"><select name="select_answer1" id="select_answer1">
          <option value="1">A</option>
          <option value="2">B</option>
          <option value="3">C</option>
          <option value="4">D</option>
        </select>
        </td>
      </tr>
    </table>
    </div>    </td>
  </tr>
</table>
<?php
  }
  else if($_POST['type']==1)
  {
  ?>
<table id="ques_table" width="419" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="411">
    <div style="margin:0 auto">
    <table width="355" height="44" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="115" height="22" align="right" valign="top">Question : <span id="ques_up1">1 </span> </td>
        <td width="240" height="22" align="left"><textarea name="question1" id="question1" cols="30" rows="3"></textarea></td>
      </tr>
      <tr>
        <td height="22" align="right">Ans :</td>
        <td height="22" align="left"><select name="select_answer1" id="select_answer1">
          <option value="1">True</option>
          <option value="2">False</option>
                  </select>
        </td>
      </tr>
    </table>
    </div>    </td>
  </tr>
</table>
<?php
}
if($_POST['type']==3)
{
?>
 <table id="ques_table" width="419" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="411">
    <div style="margin:0 auto">
    <table width="355" height="22" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="115" height="22" align="right" valign="top">Question : <span id="ques_up1">1 </span> </td>
        <td width="240" height="22" align="left"><textarea name="question1" id="question1" cols="30" rows="3"></textarea></td>
      </tr>
    </table>
    </div>    </td>
  </tr>

</table
  ><?php
}?>
</p>
<table width="417" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="72"><span class="smartlink" onclick="cloneInput('#ques_table')">Add new</span></td>
    <td width="345"><span class="smartlink" onclick="removeInput('#ques_table')">Delete recent</span>
      <input type="hidden" name="no_q" id="no_q" value="1" /><input type="hidden" name="testid" id="testid" value="<?php echo $_POST['testid']; ?>"/>
    <input type="hidden" name="type" id="type" value="<?php echo $_POST['type']; ?>"/></td>
  </tr>
</table>
<table width="609" height="64" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="32" align="right">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="197" height="32" align="right">&nbsp;</td>
    <td width="412"><input type="image" name="next" id="next" src="img/buttons/submit.gif" onclick="update_qb()" />    </td>
  </tr>
</table>
